package slice

import "gitee.com/ekit/internal/errs"

func Base[T any](src []T, index int) error {
	// 1. 越界判断
	length := len(src)
	if index < 0 || index > length {
		return errs.NewErrIndexOutOfRange(length, index)
	}
	return nil
}
